package oa.user.websercvice.client;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

public class TestMain {

	public static void main(String[] args) throws ParseException {
		CheckInOutService_Service factory = new CheckInOutService_Service();
		CheckInOutService checkInOutService = factory
				.getCheckInOutServicePort();
		
		String format = "yyyy-MM-dd HH:mm:ss";
        SimpleDateFormat formatter = new SimpleDateFormat(format);
        
		RequestData requestData = new RequestData();
		requestData.setUserId("027");
		requestData.setPageSize("10");
		requestData.setCurrPage("1");
		requestData.setTotalCount("0");
		
        requestData.setBeginCheckTime(DateUtils.convertToXMLGregorianCalendar(formatter.parse("2007-07-31 11:45:45")));
        requestData.setEndCheckTime(DateUtils.convertToXMLGregorianCalendar(formatter.parse("2012-08-27 11:45:52")));
       	
		
		WebData data = checkInOutService.findByUser(requestData);
		System.out.println("flag: "+data.getFlag());
		List<Checkinout> listData = data.getData();
		
		
         

         
		for (Checkinout cio : listData) {
			System.out.println(cio.getUserid());
			System.out.println(formatter.format(DateUtils.convertToDate(cio.getChecktime())));		
		}
		System.out.println("是否有上一页: "+data.isHasLast());
		System.out.println("是否有下一页: "+data.isHasNext());
		System.out.println("总数: "+data.getTotalCount()+",总页数: "+data.getTotalPage());
	}

}
